<div class = "main-view"><!--最外层div-->
    <div class="left-margin top-margin"><strong class="am-text-primary am-text-lg">积分策略</strong></div>
    <form class="am-form-inline left-margin top-margin" role="form">
        <div class="am-form-group">
            <label>名称</label> <input type="text" class="am-form-field" ng-model="name">
        </div>
        <button type="submit" class="am-btn am-btn-primary" ng-click="search()">搜索</button>
    </form>
    <br>
    <div class="am-btn-group am-btn-group-xs left-margin top-margin">
        <button type="button" class="am-btn am-btn-default" data-am-modal="{target: '#doc-modal-add', width: 800, height: 450}"><span class="am-icon-plus"></span> 新增</button>
        <button type="button" class="am-btn am-btn-default" ng-click="delete()"><span class="am-icon-trash-o"></span> 删除</button>
    </div>
    <div id = "pagination" class = "pagination"></div>
    <div class="pagination-table left-margin" id="tab_menu" style = "margin-top: 0px;">
        <form class="am-form">
            <table class="am-table-striped am-table-hover table-main">
                <thead>
                <tr>
                    <th class="table-check"><input type="checkbox" ng-click="allSelected()"></th>
                    <th class="table-id">流水ID</th>
                    <th class="table-title">积分来源项的类型</th>
                    <th class="table-title">积分来源项</th>
                    <th class="table-id">单次操作增加积分值</th>
                    <th class="table-id">每天累加积分上限</th>
                    <th class="table-title">每月累加积分上限</th>
                    <th class="table-title">最后修改时间</th>
                    <th class="table-title">英文名称</th>
                    <th class="table-title">只一次生效</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="integralStrategy in integralStrategyList" id = "{{integralStrategy.id}}">
                    <td class="table-check"><input type="checkbox" class = "item-check"></td>
                    <td>{{integralStrategy.id}}</td>
                    <td>{{integralStrategy.item_type}}</td>
                    <td>{{integralStrategy.item_name}}</td>
                    <td>{{integralStrategy.item_value}}</td>
                    <td>{{integralStrategy.item_value_limit_day}}</td>
                    <td>{{integralStrategy.item_value_limit_month}}</td>
                    <td>{{integralStrategy.update_time | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <td>{{integralStrategy.name}}</td>
                    <td>{{integralStrategy.is_single_limit}}</td>
                    <td>
                        <button class="am-btn am-btn-default am-btn-xs am-text-secondary" data-am-modal="{target: '#doc-modal-{{$index}}', width: 800, height: 450}"><span class="am-icon-pencil-square-o"></span> 编辑</button>
                        <!--编辑框 -->
                        <div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-{{$index}}">
                            <div class="am-modal-dialog">
                                <div class="am-modal-hd border-bottom" style = "text-align: left;">菜单编辑
                                    <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
                                </div>
                                <div class="am-modal-bd body-area">
                                    <div style = "width: 90%;" class = "text-left">
                                        <form>
                                            <div><label>积分来源项的类型</label><input type="text" class = "modal-input" ng-model="integralStrategy.item_type" style = "width: 200px;display: inline-block;"></div>
                                            <div><label>积分来源项</label><input type="text" class = "modal-input" ng-model="integralStrategy.item_name" style = "width: 200px;display: inline-block;"></div>
                                            <div><label>单次操作增加积分</label><input type="text" class = "modal-input" ng-model="integralStrategy.item_value" style = "width: 200px;display: inline-block;"></div>
                                            <div><label>每天累加积分上限</label><input type="text" class = "modal-input" ng-model="integralStrategy.item_value_limit_day" style = "width: 200px;display: inline-block;"></div>
                                            <div><label>每月累加积分上限</label><input type="text" class = "modal-input" ng-model="integralStrategy.item_value_limit_month" style = "width: 200px;display: inline-block;"></div>
                                            <div><label>英文名称</label><input type="text" class = "modal-input" ng-model="integralStrategy.name" style = "width: 200px;display: inline-block;"></div>
                                            <div><label>只一次生效</label><input type="text" class = "modal-input" ng-model="integralStrategy.is_single_limit" style = "width: 200px;display: inline-block;"></div>
                                        </form>
                                    </div>
                                </div>
                                <div class = "button-area border-top">
                                    <button type="button" class="am-btn am-btn-success right-margin top-margin" ng-show="true" ng-click="update(integralStrategy,$index)">保存</button>
                                </div>
                            </div>
                        </div>


                    </td>
                </tr>
                </tbody>
            </table>
        </form>
    </div>

    <div class = "left-margin">共<span id = 'page_number'>{{pageNumber}}</span>页 <span>{{count}}条数据</span></div>
    <!--新增框 -->
    <div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-add">
        <div class="am-modal-dialog">
            <div class="am-modal-hd border-bottom" style = "text-align: left;">新增积分策略
                <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
            </div>
            <div class="am-modal-bd body-area">
                <div style = "width: 90%;" class = "text-left">
                    <form>
                        <div><label>积分来源项的类型</label><input type="text" class = "modal-input" ng-model="addData.item_type"></div>
                        <div><label>积分来源项</label><input type="text" class = "modal-input" ng-model="addData.item_name"></div>
                        <div><label>单次操作增加积分</label><input type="text" class = "modal-input" ng-model="addData.item_value"></div>
                        <div><label>每天累加积分上限</label><input type="text" class = "modal-input" ng-model="addData.item_value_limit_day"></div>
                        <div><label>每月累加积分上限</label><input type="text" class = "modal-input" ng-model="addData.item_value_limit_month"></div>
                        <div><label>英文名称</label><input type="text" class = "modal-input" ng-model="addData.name"></div>
                        <div><label>只一次生效</label><input type="text" class = "modal-input" ng-model="addData.is_single_limit"></div>
                    </form>
                </div>
            </div>
            <div class = "button-area border-top">
                <button type="button" class="am-btn am-btn-success right-margin top-margin" ng-show="true" ng-click="add(addData)">保存</button>
            </div>
        </div>
    </div>
</div>